const express = require('express');
const router = express.Router();

/* GET users listing. */
router.get('/', function(req, res, next) {
  res.send('respond with a resource');
});

/* GET users listing. */
router.get('/list', function(req, res, next) {
  const users = [
    {
      name: "君陌",
      order: "1",
      address: "书院二层楼",
      info: "二师兄,浩然剑气，剑气凌天起，万丈雪山平"
    },
    {
      name: "君陌",
      order: "2",
      address: "书院二层楼",
      info: "二师兄,浩然剑气，剑气凌天起，万丈雪山平"
    },
    {
      name: "余帘",
      order: "3",
      address: "书院二层楼",
      info: "三师姐，簪花小楷旧书楼,二十三年识春秋"
    },
    {
      name: "木柚",
      order: "4",
      address: "书院二层楼",
      info: "七师姐，温婉可人，纤纤玉手绣锦图，亦可翻手起云雾"
    }
  ]

  res.render('users', { title: '用户信息',users:users});
});

/* GET home page. */
router.get('/', function(req, res, next) {
  // res.render('index', { title: 'Express' });
  router.render("/admin/home.html")
  next()
});

module.exports = router;
